<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<sfa:mainTitle></sfa:mainTitle>
		<%@ include file="/common/meta.jsp"%>

	<link rel="stylesheet" type="text/css"
			href="${path}/css/step/an.css" >
			
		<style type="text/css">
* {
	margin: 0;
	padding: 0;
}

.tc_box {
	width: 400px;
	height: 200px;
	border: 2px solid red;
	position: absolute;
	z-index: 2000;
	background: #FFC;
	display: none;
}

.sp_box {
	width: 100%;
	position: absolute;
	z-index: 1000;
	background: #000;
	top: 0;
	left: 0;
	display: none;
}
.main .formdiv {
	width: 400px;
}
</style>

		<script type="text/javascript" src="${path}/ckeditor/ckeditor.js"></script>
		<script type="text/javascript" src="${path}/ckfinder/ckfinder.js"></script>
		<script type="text/javascript" src="/ckeditor/ckeditor.js?t=B37D54V"></script>
		<link rel="stylesheet" href="${path }/css/affixUpload.css" type="text/css"></link>
		<script type="text/javascript" src="${path}/script/affixUpload.js"></script>
		<script type="text/javascript">

$(function() {

	//初始化控件 --1
	var actionPath = "${path}/affix/index/upload/SALEMEETING";
	var div = 'sfaUpload'
	sfaUpload.init(actionPath,div);

	
	$("#clear").click(function() {
		$(".inputbox").val("");
		$(".areabox").val("");
	});

	$("#next").click(function() {
		//alert("dddddddddd");

		var url = "${path}/manage/meetings/index/inner/validate";
		var title = $("#meetingTitle").val();

		var content = CKEDITOR.instances.meetingContent.getData();

		var param = {
			"meetingTitle" : title,
			"meetingContent" : content
		};
		$.post(url, param, function(data) {
			
			var json =eval(data);
			//alert(json);
			if (json.result ==true) {
				$("#step1").css("display", "none");
				$("#step2").css("display", "block");
				
				$("#firstStep").attr("class", "");
				$("#firstStep_line").attr("class","line_last");
				$("#secondStep").attr("class","now");
				$("#secondStep_line").attr("class","line_frist");
			} else {
				$(".meetingTitle").html(json.meetingTitle);
				$(".meetingContent").html(json.meetingContent);
			}
		});

	});
	
	$("#provi").click(function() {

				$("#step2").css("display", "none");
				$("#step1").css("display", "block");
				

				$("#firstStep").attr("class", "now");
				$("#firstStep_line").attr("class","line_frist");
				$("#secondStep").attr("class","");
				$("#secondStep_line").attr("class","line");


	});

	$("#submit").click(
			function() {
			
			if (sfaUpload.getIsUploading()) {
			art.dialog( {
				content : "文件正在上传,请先取消上传文件！",
				lock : true,
				ok : true
			});
			return;
		}
			

				//alert("sssssssss");
				var url = "${path}/manage/meetings/index/inner/add";
				var title = $("#meetingTitle").val();
				var content = CKEDITOR.instances.meetingContent.getData();
				var master = $("#meetingMaster").val();
				var count = $("#mCount").val();
				var start = $("#sDate").val();
				var end = $("#eDate").val();
				var affixStr="";
				$(".uoloadedFile").each(function(i,o){
					var obj=$(o);
					affixStr +=obj.attr("SALEAFFIXITEMID")+";"+obj.attr("isDel")+";;";
				});
				//alert(branchs);

				var param = {
					"meetingTitle" : title,
					"meetingContent" : content,
					"meetingMaster" : master,
					"mCount" : count,
					"sDate" : start,
					"eDate" : end,
					"affixStr":affixStr
				};

				$.post(url, param, function(data) {
					//alert(data);
					var json =  eval(data);

					if (json.result ==true) {
						$("#step3").css("display", "block");
						$("#step2").css("display", "none");
						
						$("#firstStep_line").attr("class","line");
						$("#secondStep").attr("class", "");
						$("#secondStep_line").attr("class","line_last");
						$("#thirdStep").attr("class","now");
						$("#thirdStep_line").attr("class","line_over");
					
					} else {
						$(".meetingTitle").html(json.meetingTitle);
						$(".meetingContent").html(json.meetingContent);
						$(".mCount").html(json.meetingCount);
						$(".startDate").html(json.startDate);
						$(".endDate").html(json.endDate);
					}
					$(".add").html(json.add);
				});
				});
				
				

	
});
</script>

		<link rel="stylesheet" type="text/css"
			href="${path}/css/addnews/step1.css" id="step">

	</head>



	<body id="master">

		<sfa:mainHeader></sfa:mainHeader>

			<!--右边-->
            <div class="webpart3 contentarea">
                <div class="webpart-head">
                    <div class="webpart-head-item">
                        新建早会
                    </div>
                </div>
                <div class="webpart-main">
                    <div class="webpart-main-item" style="padding: 12px;">
                    	
                    	<div class="at_loc">
		<span class="now" style="width:208px;" id="firstStep">1.填写早会标题｜内容</span>
		<span class="line_frist" id="firstStep_line"></span>
		<span style="width:208px;" id="secondStep">2.设置流程</span>
		<span class="line" id="secondStep_line"></span>
		
		<span style="width:208px;" id="thirdStep">3.确认结果</span>
		<span class="line_end" id="thirdStep_line"></span>
		</div>
                    	
                    	
                        <div class="d_formitem">
                        
                        <input type="hidden" class="inputbox" id="createUid"
											name="createUid" value="${user.saleUsersLoginId}">
							<div id="step1">				
                            <table cellspacing="0" cellpadding="0"  >
                                <tr>
                                    <th style="width: 60px;">
                                        早会标题:
                                    </th>
                                    <td>
                                        <input type="text" class="input-txt" id="meetingTitle"
											name="meetingTitle" style="width: 400px;" />
									<font color="red">*</font>	<font color="red" class="meetingTitle">${meetingTitle}</font>
                                    </td>
                                </tr>
                                <tr>
                                 
                                    <td   colspan="2" align="left">
										<textarea rows="6" cols="40" name="meetingContent"
											id="meetingContent"></textarea>

										<font color="red" class="meetingContent">${meetingContent}</font>
									</td>
                                </tr>
                                <tr>
                                    <td align="center">
										<input name="next" type="button" id="next" tabindex="5"
											class="linkbtn2" value="下一步">
									</td>
                                </tr>
                                
                            </table>
                             <ckfinder:setupCKEditor editor="meetingContent"
							basePath="/sfa/ckfinder/" />
						<ckeditor:replace replace="meetingContent" basePath="/ckeditor/"></ckeditor:replace>
						</div>
						
						
						
						<div id="step2" style="display: none;">				
                            <table cellspacing="0" cellpadding="0" class="formitem">
                                <tr>
                                    <th style="width: 75px;">
                                        早会主持人:
                                    </th>
                                    <td>
                                        <input type="text" class="input-txt" id="meetingMaster" style="width: 40%;"
											name="meetingMaster" value="${user.userName}" readonly="readonly"/>
									<font color="red">*</font>	<font color="red" class="meetingMaster">${meetingMaster}</font>
                                    </td>
                                </tr>
                                <tr>
                                 
                                   <th>
                                   参会人数:
                                   </th>
                                   <td>
                                   <input type="text" class="input-txt" id="mCount" style="width: 40%;"
											name="mCount" />
									<font color="red">*</font>	<font color="red" class="mCount">${mCount}</font>
                                   </td>
                                </tr>
                                <tr>
                                	<th>
                               开会时间:
                                	</th>
                                    <td >
										<input id="sDate" name="sDate" type="text"  style="width: 40%;"
										onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="Wdate input-txt" readOnly="true" value="${startDate}"
										/><font color="red">*</font>
										<font color="red" class="startDate">${startDate}</font>
									</td>
                                </tr>
                                 <tr>
                                	<th>
                               结束时间:
                                	</th>
                                	<td>
                                    <input id="eDate" name="eDate" type="text"  style="width: 40%;"
										onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="Wdate input-txt" readOnly="true" value="${endDate}"
										/><font color="red">*</font>
										<font color="red" class="endDate">${endDate}</font>
									</td>
                                </tr>
                                
                                 <tr>
                                	
                              		<td colspan="2" align="left">
                              		<span  class="webpart-head-item" style="font-weight: bold;">上传附件 </span>
									<hr />
							
										<div id="fileList">   
										</div>
										<div id="sfaUpload" style="color: red;"></div>
									</td>
                                </tr>
                                <tr>
								<th colspan="2">
									<input name="submit" type="button" id="submit" tabindex="5"
										class="linkbtn2" value="提交">&nbsp;<input name="provi" type="button" id="provi" tabindex="5"
											class="linkbtn2" value="上一步">
								</th>
							</tr>
                                
                            </table>
                              
						</div>
						<div id="step3" style="display: none;">
				
					<div>
						<font color="red" class="add"> </font><a
							href="${path}/manage/meetings/index/inner/addmeeting">继续添加</a>
							|<a href="${path}/manage/meetings/index/inner/getmeetings">跳到管理页面</a>
					</div>
					
					
						</div>
						
						
                        </div>
                    </div>
                </div>
                <div class="webpart-foot">
                    <div class="webpart-foot-item">
                    </div>
                </div>
            </div>
		<sfa:mainFooter></sfa:mainFooter>


	</body>
</html>


